#include <stdio.h>
#include <string.h>
#include <stdlib.h>

#include "base64.h"

int main(int argc, char *argv[])
{
	int i = 0;
	char *a = NULL;
	char *b = NULL;
	char *src[] = {"abc", "abcd", "abcde"};

	printf("base64 test:\n");

	for (i = 0; i < sizeof(src) / sizeof(src[0]); i++) {
		a = base64_encode(src[i], strlen(src[i]));
		printf("  encode(\"%s\") = %s\n", src[i], a);

		b = base64_decode(a);
		printf("  decode(\"%s\") = %s\n", a, b);

		printf("\n");

		free(a);
		a = NULL;

		free(b);
		b = NULL;
	}

	return 0;
}
